home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <winb.h>
- #include <te.h>
- #include <fntb.h>
- #include <gui.h>
- #include <egb.h>
- #include <guidbg.h>
-
- #include <mos.h>
- #include <eintm.h>
-
- char *guiEgbPtr ; /* EGB のワークアドレス */
-
- int masterHyperID = -1 ;
- int iconDialogID = -1 ;
- int iconDummyDButtonID = -1 ;
- int iconQuitIconID = -1 ;
- int iconMessageID = -1 ;
-
- char msg[] = "888\0";
- unsigned int beforeTime,afterTime;
-
- int quitFuncRet = ILLEGAL_FUNCTION ;
-
- int userFunc(apliId, messId, info, data)
- int apliId;
- int messId;
- int info;
- int data;
- {
- register int ret;
-
- ret = ILLEGAL_FUNCTION;
-
- switch(messId)
- {
- case GM_QUIT :
- MMI_SendMessage(iconQuitIconID,MM_EXEC,2,0,0);
- ret = quitFuncRet ;
- break;
- }
-
- return(ret);
- }
-
- void main()
- {
- static MMICTRL mmi ={
- SCREEN16|SCREENIGNORE, // ページ0側解像度
- SCREENUNUSED, // ページ1側解像度
- 0, // 書き込みページ
- SCREENAVAILABLE, // 表示ページ
- 0, // 表示プライオリティ
- SCREENAVAILABLE, // 色数
- SCREENEXPAND, // VRAMの横の長さ
- 0, // メモリ領域の大きさ
- NULL, // メモリ領域のアドレス
- 0, // ユーザ領域の大きさ
- NULL, // ユーザ領域のアドレス
- 0, 0, // 画面枠 lupx,lupy
- 0, 0, // rdwx,rdwy
- -16384, -16384, // 移動枠 lupx,lupy
- 16383, 16383, // rdwx,rdwy
- 15, // 白色
- 8, // 黒色
- 7, // 灰色
- 6 // 反転色
- };
-
- extern int APL_init() ;
-
- /* 初期化処理 */
- if (MMI_Open( &mmi ) == NOERR)
- {
- /* 初期化に成功すればメインループに入る. */
- if (APL_init() == NOERR)
- MMI_ExecSystem() ;
- }
-
- /* 終了処理 */
- MMI_Close() ;
-
- }
-
- int APL_init()
- {
- extern MMIINIT initDataGUI ;
-
- register int ret ;
-
- /* EGB ワークアドレスの取得. */
- guiEgbPtr = MMI_GetEgbPtr() ;
-
- /* ユーザアイコン設定 */
- extern unsigned char *iconTbl[];
- extern int iconMaxId;
- MMI_SetIconTable(iconTbl, iconMaxId);
-
- /* ハイパ型部品の初期化 */
- if ((ret = MMI_initHyper()) < 0)
- return ret ;
- /* ダイアログ型部品の初期化 */
- if ((ret = MMI_initDialogL40()) < 0)
- return ret ;
- /* メッセージ型部品の初期化 */
- if ((ret = MMI_initMessageL40()) < 0)
- return ret ;
- /* ボタン型部品の初期化 */
- if ((ret = MMI_initButtonL40()) < 0)
- return ret ;
- /* ドロウボタン型部品の初期化 */
- if ((ret = MMI_initDrawButtonL40()) < 0)
- return ret ;
- /* アイコンボタン型部品の初期化 */
- if ((ret = MMI_initIconL40()) < 0)
- return ret ;
-
- /* 背景データの初期化 */
-
- /* データの登録 */
- if ((ret = MMI_Init(&initDataGUI)) < 0)
- return ret ;
-
- // Tmenuにパレットを合わせる
- EIN_initGuiColor();
-
- MMI_SendMessage(iconMessageID, MM_SETMSG,1,msg) ;
-
- /* 背景を表示する */
- MMI_SendMessage(MMI_GetBaseObj(), MM_SHOW, 0) ;
-
- MMI_SendMessage(MMI_GetBaseObj(), MM_SETEXEC, 1, userFunc);
- MMI_CallMessage(MMI_GetApliId(), GM_TITLE, (int)"burden By 機拡", 0);
-
- extern void userIdleTask();
- MMI_SetIdleTaskFunc( userIdleTask );
- beforeTime = MOS_getTime();
- userIdleTask();
-
- return NOERR ;
- }
-
- void userIdleTask(void)
- {
- register unsigned int i;
-
- afterTime = MOS_getTime();
-
- i = afterTime - beforeTime;
-
- msg[0] = '0' + ((i/100)%10);
- msg[1] = '0' + ((i/ 10)%10);
- msg[2] = '0' + ( i %10);
- MMI_SendMessage(iconMessageID,MM_SHOW,0);
-
- beforeTime = afterTime;
-
- return ;
- }
-
- /* initDataGUI:iconQuitIconID:MJ_ICONL40の呼び出し関数 */
- int iconQuitFunc(kobj, messId, argc, pev, trigger)
- int kobj ;
- int messId ;
- int argc ;
- EVENT *pev ;
- int trigger ;
- {
- MMI_SetHaltFlag(TRUE);
- quitFuncRet = NOERR ;
-
- return NOERR ;
- }
-